package org.docmanagement.commons.service;

import java.util.List;


public interface GenericService<T> {
	/**
	 * Add an item
	 * @param o
	 */
    public Integer add(T o) throws ServiceException;
    /**
     * Looks up an item by ID.
	 * @param id the ID for the element
	 * @return Element
	 */
    public T findById(Integer id) throws ServiceException;
	/**
	 * Update an item
	 * @param o
	 */
    public void update(T o) throws ServiceException;
	/**
	 * Remove an item by id
	 * @param id the ID for the category
	 */
    public void removeById(Integer id) throws ServiceException;
	/**
	 * Remove an item
	 * @param objectToRemove the object to remove
	 */
    public void remove(T objectToRemove) throws ServiceException;
	/**
	 * Retreive all the items
	 */
    public List<T> findAll() throws ServiceException;
}
